import Vue from 'vue';

const state ={
    advData:[]
}

const getters = {
    adv(state){
        return state.advData
    }
}

const actions = {
    getAdv({state,commit}){
        Vue.prototype.$fetch({
            url:'/adv',
            method:'GET'
        }).then(res=>{
            commit('putAdvData',res.data.listData)
        })
    }

}

const mutations = {
    putAdvData(state,data){
        state.advData = data;
    }
}

export default {
    state,
    getters,
    actions,
    mutations
}